const axios = require('axios')
const { DE_MAIN } = require('./config')

const service = axios.create({
  baseURL: `${DE_MAIN}:3001/api`,
  timeout: 1000 * 60 * 10
})

// response interceptor
service.interceptors.response.use(response => {
  const res = response.data

  return res
}, error => {
  console.log('err' + error) // for debug
  return Promise.reject(error)
})

module.exports = service